import style from './App.module.css';
import { Redirect, Route } from "react-router-dom";
import { routes } from '@/router';
import { WithLazy } from './utils/withLazy';

import React, { Component } from 'react'

class App extends Component {

  render() {
    return (
      <div className="App">
        <Redirect exact={true} from="/" to="/Home"></Redirect>
        {
          routes.map(item => <Route key={item.path} path={item.path} component={WithLazy(() => import(`@/views/${item.component}`))}></Route>)
        }
      </div>
    )
  }
}

// const mapStateToProps = state => ({ isLoading1: state.isLoading1 })

// export default connect(mapStateToProps)(App);
export default App;
